﻿@namespace BootstrapBlazor.Components
@inherits IdComponentBase

<div @attributes="@AdditionalAttributes" id="@Id" class="@DirectionClassName">
    <button type="button" class="@ButtonClassName" data-bs-toggle="@DropdownToggle" aria-expanded="false">@Text</button>
    @if (ShowSplit)
    {
        <button type="button" class="@ClassName" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
    }
    <div class="@MenuAlignmentClass">
        @foreach (var item in Items)
        {
            <div class="@ActiveItem(item)" @onclick="e => OnItemClick(item)">
                @if(!string.IsNullOrEmpty(item.Icon))
                {
                    <i class="@item.Icon"></i>
                }
                @if(!string.IsNullOrEmpty(item.Text))
                {
                    <span>@item.Text</span>
                }
            </div>
        }  
    </div>
</div>